package models

import (
	"io"
	"mime/multipart"
	"os"
)

func GetImage(f multipart.File, m *multipart.FileHeader, e error) string {
	file, err := os.OpenFile("./static/img/"+m.Filename, os.O_CREATE|os.O_APPEND|os.O_RDWR, 777)
	if err != nil {
		return ""
	}
	io.Copy(file, f)
	return "http://14.103.158.217:8080/static/img/" + m.Filename
}
